package com.gitee.srurl.core.constant;

/**
 * redis 常量
 *
 * @author zxw
 * @date 2023/5/2 14:06
 */
public interface RedisConstant {

    interface Bloom {

        /**
         * short id 是否存在的布隆过滤器key前缀
         */
        String SHORT_ID_BLOOM_BASE_KEY = "su:bloom:short-id";

        /**
         * 重复ID md5类型
         */
        String BLOOM_DUPLICATE_MD5 = SHORT_ID_BLOOM_BASE_KEY + ":duplicate:md5";

        /**
         * 重复ID murmur hash类型
         */
        String BLOOM_DUPLICATE_MURMUR = SHORT_ID_BLOOM_BASE_KEY + ":duplicate:murmur";
    }

    interface Cache {

        /**
         * 访问记录缓存
         */
        String RECORD_CACHE = "su:record:cache:";

        /**
         * 访问记录缓存
         */
        String VISIT_TIMES_CACHE = "su:visit:times:";

        /**
         * 双重缓存检测
         */
        String DOUBLE_DUPLICATE_CACHE = "su:duplicate:double-duplicate:";
    }

    interface Lock {

        /**
         * id生成锁的key前缀
         */
        String ID_GEN_LOCK = "su:id-gen:lock:";
    }

    interface User {

        /**
         * api用户信息
         */
        String API_USER_LOGIN = "su:user:api:";
    }
}
